Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

172
Views
Trying to make a discord but I keep getting the error "required is not defined"

I'm really new at this and I'm trying to get the bot to come online but no matter what I do the error message comes up, I also downloaded requirejs but it doesn't seem to be working. basically, I have no idea what I'm doing and need help.

const {Clients, Intents} = require(discord.js);
const TOKEN = '************************************************'
const client = new Client({
    intents: [
        Inents.FLAGS.GUILDS,
        Intents.FLags.GUILD_MESSAGES,
    ]
});




client.once('ready', () => {
    console.log('Logged in as ${client.user.tag}')
});
client.login(TOKEN);
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You need to put discord.js in quotes like this:

const {Clients, Intents} = require("discord.js");
about 4 years ago · Juan Pablo Isaza Report

0

A couple things. Don't give out your token on public websites. Discord has probably dmed you saying you gave out your token here, but still. I'd recommend creating a .env file with the 'dotenv' package (if you know what that is.) just to keep your token private.

On your 5th line, Intents has a typo, it says Inents. So, make sure that's fixed, and same with the 6th line. It should be FLAGS not FLags

The reason "require" isn't defined is because you need to put discord.js in quotations like this.

const {Clients, Intents} = require('discord.js');

If you have any other errors, feel free to reply with it. Have a great day.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!